home *** CD-ROM | disk | FTP | other *** search
/ Java Certification Exam Guide / McGrawwHill-JavaCertificationExamGuide.iso / pc / Web Links and Code / exer / chap11 / exer1103 / Gaps.java
Encoding:
Java Source  |  1997-04-20  |  466 b   |  17 lines

  1. import java.io.*;
  2.  
  3. class Gaps {
  4.    public static void main(String[] args) throws Exception {
  5.       File f = new File("Gaps.test");
  6.       RandomAccessFile out = new RandomAccessFile(f, "rw");
  7.       out.writeBytes("1 3 5");
  8.       System.out.println("len is " + out.length());
  9.  
  10.       // Supply the missing code here to write out "2" and "4"
  11.       // in the gaps in the character "1 3 5" already written to 
  12.       // the file.
  13.  
  14.       out.close();
  15.    }
  16. }
  17.